import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description：简单猜数字游戏
 * User: cjc
 * Date: 2025-03-02
 * Time: 20:07
 */
public class Test2 {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner scanner = new Scanner(System.in);
        int GuessNum = random.nextInt(100);//产生[0,100)的整数数字
        int count = 5;
        while(true) {
            System.out.println("请输入0~100的数字");
            int num = scanner.nextInt();
            if(num > GuessNum) {
                System.out.println("猜大了");
            }else if(num < GuessNum) {
                System.out.println("猜小了");
            } else {
                System.out.println("恭喜猜对了！");
                break;
            }
            count--;
        }
    }
}
